<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>关键技术列表</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
    <link rel="stylesheet" href="../css/page_css/util.css">
</head>

<body>
	<div class="mui-content">
    <ul class="mui-table-view01">
			 <li class="search-cell">
			 	<div class="mui-input-row mui-search">
					<input type="search" id="searchText" onclick="openSearchWin()" readonly="readonly" class="mui-input-clear" placeholder="请输入关键字" ><span class="mui-icon mui-icon-clear mui-hidden"></span><span class="mui-placeholder"><span></span></span>
				</div>
				<div class="mui-btn mui-btn-primary" tapmode onclick="Search()">
					搜索
				</div>
			 </li>
		</ul>
    <ul class="mui-table-view work_order_list" id="ordrListsContent">
        <script type="text/template" id="itemslist">
            {{each datas as item i}}
            <li class="mui-table-view-cell" onclick="openOrderWin('{{item.worktype}}', '{{item.typeName}}')">
                <div class="mui-table mui-navigate-right">
                    <div class="mui-table-cell mui-col-xs-8">
                        <h4 class="mui-ellipsis" style='font-size: 16px'>{{item.typeName}}</h4>
                    </div>
                    <div class="mui-table-cell mui-col-xs-4 mui-text-right">
                        <span class="mui-badge mui-badge-warning">{{item.finishCnt}}/{{item.cnt}}</span>
                    </div
                </div>
            </li>
            {{/each}}
        </script>
    </ul>
	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/template.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
  var UISearchBar = null;
	apiready = function () {
    UISearchBar = api.require('UISearchBar');
    ajaxrd("queryWorktypeList", {
        token: $api.getStorage('partsInfo').token,
        orderType: 'S02, S03, T03, T05'
    }, function(ret, err) {
        AddData('itemslist', 'ordrListsContent', ret)
    })
	}
  function openOrderWin(name, typeName) {
      openWin('key_technology', typeName, {
          background: '#6098de',
          color: '#fff'
      }, {
          orderType: name
      })
  }
  function openSearchWin(){
    UISearchBar.open({
        placeholder: '请输入搜索关键字',
        historyCount: 10,
        showRecordBtn: false,
        dataBase: 'workOrder',
        texts: {
            cancelText: '取消',
            clearText: '清除搜索记录'
        },
        styles: {
            navBar: {
                bgColor: '#3398dc',
                borderColor: '#ccc'
            },
            searchBox: {
                bgImg: '',
                color: '#000',
                height: 35,
                size: 13
            },
            cancel: {
                bg: 'rgba(0,0,0,0)',
                color: '#fff',
                size: 15
            },
            list: {
                color: '#696969',
                bgColor: '#FFFFFF',
                borderColor: '#eee',
                size: 15
            },
            clear: {
                color: '#000000',
                borderColor: '#ccc',
                size: 15
            }
        }
    }, function(ret, err) {
        if (ret && (ret.eventType == 'search' || ret.eventType == 'history')) {
            // $api.val($api.byId('searchText'),ret.text);
            openWin('key_technology', '关键技术列表', {
                background: '#6098de',
                color: '#fff'
            }, {
              searchText: ret.text,
              discription: ret.text,
              orderType: 'S02, S03, T03, T05'
            })
        }
    });
  }
</script>

</html>
